<template>
  <div :class="isShow?'show':'hide'" class="global_cover" @click.stop></div>
</template>

<script>
export default {
  name: 'GlobalCover',
  data () {
    return {
      isShow: false
    }
  },
  created () {
    let that = this
    alphaHub.$on('cover_show', function () {
      that.isShow = true
    })
    alphaHub.$on('cover_hide', function () {
      that.isShow = false
    })
  }
}
</script>
<style lang="scss" scoped>
.global_cover {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: black;
  opacity: 0;
  visibility: hidden;
  z-index: 49;
  -webkit-transition: all 0.4s ease;
  -o-transition: all 0.4s ease;
  transition: all 0.4s ease;
  transform: translateZ(-1000px);
}
.show {
  opacity: 0.8;
  visibility: visible;
}
.hide {
  opacity: 0;
  visibility: hidden;
}
</style>
